package cn.chengpengper.seckill.common.exception;

import cn.chengpengper.seckill.common.code.HttpCode;
import lombok.Getter;

import java.io.Serializable;

/**
 * @author chengpeng.hu
 */
@Getter
public class SeckillException extends RuntimeException implements Serializable {

    private static final long serialVersionUID = 5266115825116018862L;

    private Integer code;

    public SeckillException(String message) {
        super(message);
    }

    public SeckillException(HttpCode errorCode) {
        this(errorCode.getCode(), errorCode.getMessage());
    }

    public SeckillException(Integer code, String message) {
        super(message);
        this.code = code;
    }
}
